package org.jash.sportnews2109.utils

import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer

class VideoLifecycle(val player:StandardGSYVideoPlayer) : DefaultLifecycleObserver {
    override fun onStop(owner: LifecycleOwner) {
        super.onStop(owner)
        player.onVideoPause()
    }
    override fun onDestroy(owner: LifecycleOwner) {
        super.onDestroy(owner)
        player.release()
    }
}